package com.sassds;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
@EnableHystrix
public class TestController extends SpringBootServletInitializer {

    @Autowired
    private FooService fooService;

    @RequestMapping("/foo")
    public String foo() {
        try {
            return fooService.getFoo();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}